use std::fs;

use markdown_parser::parse;
// #[ignore = "能力不足"]
#[test]
fn test_markdown() {
    // let input = "[[]()[doc][link]";
    let input = fs::read_to_string("../markdown_parser/README.md").unwrap();
    let (res, errs) = parse(&input);
    assert!(res.is_some());
    let mut content = String::new();
    content.push_str("<html><bodye");
    for ele in res.unwrap().iter() {
        content.push_str(&ele.to_string());
    }
    content.push_str("</body></html>");
    let _ = fs::write("../.readme.html", content);
    if let Some(errs) = errs {
        panic!("{}", errs)
    }
}
